home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / UIFlow 1.0.1 / UIFlow Source / CFDFront / TOptPrint.cp < prev    next >
Encoding:
Text File  |  1992-02-21  |  2.8 KB  |  88 lines  |  [TEXT/MPS ]

  1. #pragma segment MenuOption
  2. //*********************************************************************************
  3. //    TOptPrint - Methods
  4. //        inherits all methods and vars from TDialogView
  5. //        overrides method : DoChoice
  6. //*********************************************************************************
  7. //    Print Variable Order
  8. //        u velocity
  9. //        v velocity
  10. //        pressure
  11. //        w velocity
  12. //        enthalpy (sigma h)
  13. //        kinetic energy
  14. //        dissipation
  15. //        mixture fraction (sigma f)
  16. //        fuel fraction (sigma fu)
  17. //        concentration fluctuation (sigma g)
  18. //        density
  19. //        chemistry variables
  20. //
  21. pascal void TOptPrint::IRes(TDocument *itsDocument, TView *itsSuperView, Ptr *itsParams)
  22.     {
  23.     inherited::IRes(itsDocument,itsSuperView,itsParams);
  24.     }
  25.     
  26. //------------------------------------------------------------------------------------------
  27. //    TOptPrint DoChoice Method... Implementation
  28. //------------------------------------------------------------------------------------------
  29. pascal void TOptPrint::DoChoice(TView *origView, short itsChoice)
  30.     {
  31.     long printO,t, t1;
  32.     short index;
  33.     TWindow * aWindow;
  34.  
  35.     aWindow = this->GetWindow();    
  36.     printO = ((TCFDFrontDocument *) fDocument)->GetPrintOpts();
  37.     switch (itsChoice)
  38.         {
  39.         case mCheckBoxHit :
  40.             for (index = 1; index <= 12; index++)
  41.                 {
  42.                 this->GetControlName(index,"PC");                                            // put name in tbox                
  43.                 if (origView == (TCheckBox *) aWindow->FindSubView(tbox.boxID))
  44.                     {
  45.                     t = pow(2,(index - 1));
  46.                     t1 = printO & t;
  47.                     if (t1 == t && !(((TCheckBox *) origView)->IsOn()))
  48.                         printO -= t;
  49.                     else if (t1 == 0 && (((TCheckBox *) origView)->IsOn()))
  50.                         printO += t;                        
  51.                     }
  52.                 }
  53.             ((TCFDFrontDocument *) fDocument)->SetPrintOpts(printO);
  54.             break;
  55.             }
  56.     inherited::DoChoice(origView,itsChoice);
  57.     }
  58.     
  59. //------------------------------------------------------------------------------------------
  60. //    Dismiss the Dialog
  61. //------------------------------------------------------------------------------------------
  62. pascal void TOptPrint::DismissDialog(ResType dismisser)
  63.     {
  64.     ((TCFDFrontDocument *) fDocument)->SetDialogOn(false,cPrintDialog);
  65.     inherited::DismissDialog(dismisser);
  66.     }
  67.  
  68. //------------------------------------------------------------------------------------------
  69. //    Decode the print options long int
  70. //------------------------------------------------------------------------------------------
  71. void TOptPrint::MarkCheckBox (Boolean * checkBox)
  72.     {
  73.     TWindow * aWindow;
  74.     TCheckBox * box;
  75.     short index;
  76.     
  77.     aWindow = this->GetWindow();                                                    // get reference to the window
  78.  
  79.     for (index = 1; index <= 12; index++)                                        // do all check boxes
  80.         {
  81.         this->GetControlName(index,"PC");                                        // puts checkbox name in tbox    
  82.         box = (TCheckBox *) aWindow->FindSubView(tbox.boxID);    // get pointer to the box
  83.             
  84.         if (checkBox[index-1])                                                            // is this box on?
  85.             box->SetState(true,false);                                                // yes mark it
  86.         }
  87.     }
  88.